import request from '@/utils/request'
import qs from 'qs'

// 获取省,区信息
export function getAreaCode(params) {
  return request({
    url: '/operate/areaCode/getAreaCode/'+params,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
    // params: params
  })
}

// 获取市信息
export function getCityStorageList(data) {
  return request({
    url: '/operate/areaCode/getAreaCode/'+data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    method: 'get',
  })
}

// 保存县仓
export function saveCityStorage(data) {
  return request({
    url: '/operate/warehouse/saveWarehouse',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data: data
  })
}

// 查询所有县仓 depotManage/getAllCounty
export function getCountyData() {
  return request({
    url: '/operate/warehouse/getWarehouse',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
  })
}
export function getAllCounty(params) {
  return request({
    url: '/operate/warehouse/getAllWarehouseList',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params:params
  })
}
export function getProInfo(params) {
  return request({
    url: '/operate/warehouse/getWarehouseAndProInfo',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params:params
  })
}
export function addProInfo(data) {
  return request({
    url: '/operate/warehouse/saveStorageProinfo',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    method: 'post',
    data
  })
}
export function getProcatList() {
  return request({
    url: '/operate/warehouse/getProcatList',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
  })
}
export function getRecordList(params) {
  return request({
      url: '/operate/warehouse/exchangeHis',
      headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
      },
      method: 'get',
      params:params
  })
}
